from django.urls import path
from .views import *

urlpatterns = [

    # 发送短信验证码
    path('smscode/',SmsCodeView.as_view({'post':'smscode'})),
    # 顾客注册
    path('register/',UserViewSet.as_view({'post':'register'})),
    # 顾客登录
    path('login/',UserViewSet.as_view({'post':'login'})),
    # 用户信息管理
    path('userinfo/',UserViewSet.as_view({'get':'userinfo','put':'update_info'})),
    # 商家下的商品分类和商品
    path('show_goods/<int:pk>/',UserViewSet.as_view({'get':'shops_goods'})),
    # 用户地址管理
    path('address/',AddressViewSet.as_view({'get':'address_list','post':'add','put':'update'})),
    # 删除用户地址
    path('address/<int:pk>/',AddressViewSet.as_view({'delete':'delete'})),
    # 收藏和取消收藏
    path('collect/<int:pk>/',CollectViewSet.as_view({'post':'add','delete':'delete'})),
    # 订单
    path('order/',OrderViewSet.as_view({'post':'add_order','get':'get_order'})),
    # 获取未支付的订单
    path('order_pay/',OrderViewSet.as_view({'get':'check_order'})),
    # 获取已支付的订单
    path('pay_order/',OrderViewSet.as_view({'get':'order_check'})),
    # 获取商品详情
    path('order/<int:pk>/',OrderViewSet.as_view({'get':'order_desc'})),
    # 获取未支付的支付地址
    path('not_order/<int:pk>/',OrderViewSet.as_view({'post':'not_order'})),
    # 评论
    path('comment/',CommentViewSet.as_view({'get':'comment_list','post':'add_comment'}))
]